#pragma once
#include "Map and Set template.h"

namespace Eclips3 {
	template<class K>
	class set {
		struct SetKeyOfT {
			const K& operator()(const K& key) {
				return key;
			}
		};
	public:
		typedef typename RBTree<K, K, SetKeyOfT>::iterator iterator;

		iterator begin() {
			return _t.begin();
		}

		iterator end() {
			return _t.end();
		}

		bool insert(const K& key) {
			return _t.insert(key);
		}

	private:
		RBTree<K, K, SetKeyOfT> _t;
	};

	void testset() {
		set<int> s;
		s.insert(3);
		s.insert(1);
		s.insert(2);

		set<int>::iterator it = s.begin();
		while (it != s.end()) {
			cout << *it << " ";
			++it;
		}
		cout << endl;

	}

}